package com.mcy.springbatch.listener;

import com.mcy.springbatch.entity.SysUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.ItemReadListener;
import org.springframework.stereotype.Component;

/**
 * 读取数据监听器
 * @author : Create By mcy
 * @date : 2019/8/26 08:42:45
 */

@Slf4j
@Component
public class ReadDataItemReadListener implements ItemReadListener<SysUser> {

    @Override
    public void beforeRead() {

    }

    @Override
    public void afterRead(SysUser item) {
        log.info("读取后：{}",item.toString());
    }

    @Override
    public void onReadError(Exception ex) {
        log.error("读取出错",ex);
    }
}
